package cn.xing.managementSystem.repository;

import cn.xing.managementSystem.domain.Course;
import cn.xing.managementSystem.domain.Information;
import cn.xing.managementSystem.enums.InformationType;
import cn.xing.managementSystem.repository.base.BaseEntityRepository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * @author cuixing
 * @package cn.xing.managementSystem.repository
 * @class InformationRepository
 * @email xing.cui@magicwindow.cn
 * @date 2018/4/25 上午11:14
 * @description
 */
public interface InformationRepository extends BaseEntityRepository<Information> {

    Information findByIdAndAndDeletedIsFalse(Long id);

    Page<Information> findByDeletedIsFalse(Pageable pageable);

    List<Information> findByInformationTypeAndDeletedIsFalseOrderByDateCreatedDesc(InformationType informationType);

    Information findFirstByInformationTypeAndDeletedIsFalseOrderByDateCreatedDesc(InformationType informationType);


}